package com.sap.sap_mangers.until;

import org.springframework.web.multipart.MultipartFile;

import java.util.Objects;

/**
 * 用于检测文件上传的文件格式
 *
 * @author 樊东升
 * @date 2022/8/23 17:54
 */
public class FileCheckUntil {

    public static Boolean checkImage(MultipartFile image) {
        String contentType = image.getContentType();
        System.out.println(contentType);
        return Objects.equals(image.getContentType(), "image/jpeg") || Objects.equals(image.getContentType(), "image/png");
    }

}
